<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>火车票售票系统首页</title>
    <link rel="stylesheet" href="../CSS/common.css">
    <link rel="stylesheet" href="../CSS/index.css">
    <script src="../JS/jquery-3.7.1.min.js"></script>
    <script src="../JS/common.js"></script>
</head>
<body>
<div id="header">
    <h1>欢迎来到火车票售票系统</h1>
<%
    String username = null;
    if (session != null) {
        username = (String) session.getAttribute("username");
    }
    if (username != null) { %>
        <p>您好，<%= username %>！</p>
<%  } %>

</div>

<div id="nav">
    <a href="/">首页</a>
    <a href="/order">我的订单</a>
<% if (session.getAttribute("username") == null) { %>
        <a href="/login">登录</a>
        <a href="/register">注册</a>
<% } else { %>
        <a href="/myInfo">我的</a>
        <a href="/logout">注销</a>
<% } %>
</div>

<div id="search">
    <h2 style="text-align: center;grid-column: 1 / 3">快速查询</h2>
    <select class="select" id="selectList">
        <option value="0">查询车号</option>
        <option value="1">查询站点</option>
        <option value="2">查询起点</option>
    </select>
    <div>
        <div class="selectItems" style="display: block">
            <button id="line" class="button">查询</button>
            <input name="line" type="text" class="select" placeholder="请输入车号">
        </div>

        <div class="selectItems" style="display: none">
            <button id="fromto" class="button">查询</button>
            <input name="from" type="text" class="select" placeholder="请输入站点1">
            <input name="to" type="text" class="select" placeholder="请输入站点2">
            <span id="swap" style="cursor: pointer">交换</span>
        </div>

        <div class="selectItems" style="display: none">
            <button id="start" class="button">查询</button>
            <input name="start" type="text" class="select" placeholder="请输入起点">
        </div>
    </div>

</div>

<div id="queryResult">
    <div class="ticket"><br><br></div>
    <div class="ticket"><br><br></div>
    <div class="ticket"><br><br></div>
    <div class="ticket"><br><br></div>
    <div class="ticket"><br><br></div>
</div>
<div id="transpage">
    <div id="first">首页</div>
    <div id="pre">上一页</div>
    <div id="next">下一页</div>
    <div id="last">尾页</div>
    <div id="inputpage">
        <input type="text" id="curpage">
        / ${count} 页
    </div>
</div>
<div id="footer">
    <span>
        友情链接 :
        <a href="http://www.12306.cn/" target="_blank">12306</a>
    </span>
    <span>版权所有 &copy; 2024 火车票售票 12305 系统</span>
</div>
<script>
    let userid = <%=session.getAttribute("userid")%>;
</script>
<script type="application/javascript" src="../JS/index.js"></script>
</body>
</html>



